1 Thinking In Pythonic
1.1 Knowing Bytes、Str、Unicode
|
|
1.2 Using List Generator Instead Of Map & Filter
|
|
1.3 Don’t Using List Generator More Than Twice With One Time
|
|
1.4 Generator Expression
|
|
1.5 Enumerate
|
|
1.6 Zip
|
|
1.7 For Else
|
|
1.8 Try Except Else Finally
|
|
2 Function
2.1 Closure
|
|
2.2 Generator
|
|
2.3 Iterate In Params
|
|
3 Property
3.1 Using property instead of get and set
|
|
4 Concurrency
4.1 用subprocess模块来管理子进程
|
|
4.2 可以用现成来执行阻塞式IO,但不要用它做平行计算
|
|
4.3 在线程中使用Lock来防止数据竞争
|
|
4.4 用Queue来协调各线程之间的工作
|
|
4.5 考虑用携程来并发地运行多个函数
|
|
4.6 考虑用concurrent.futures来实现真正的平行计算
|
|